package by.alex.dzeshko.facebooksuperclient.utils;

import android.util.Log;
import by.alex.dzeshko.facebooksuperclient.R;

public class FbPictureManager {
	
	private static final String LOG_TAG = "FbPictureManager.getMediumPictureUrl";

	public static String getMediumPictureUrl(String baseUrl){
		if(baseUrl!=null){
			try{
				String newUrl = baseUrl.replace("s.jpg", "a.jpg");
				return newUrl;
			}
			catch(Exception e)
			{
				// if can't replace, will return the inputed URL
				Log.e(LOG_TAG, e.toString());
			}
		}
		return baseUrl;
	}
	
	public static String getLargePictureUrl(String baseUrl){
		if(baseUrl!=null){
			try{
				String newUrl = baseUrl.replace("s.jpg", "n.jpg");
				return newUrl;
			}
			catch(Exception e)
			{
				// if can't replace, will return the inputed URL
				Log.e(LOG_TAG, e.toString());
			}
		}
		return baseUrl;
	}

}
